//
//  XCRecentPlayTableViewCell.m
//  SoundOfNature
//
//  Created by 梁新昌 on 16/3/22.
//  Copyright © 2016年 梁新昌. All rights reserved.
//

#import "XCRecentPlayTableViewCell.h"

@implementation XCRecentPlayTableViewCell
- (void)dealloc {
    [_dataLable release];
    [_singerLable release];
    [_songLable release];
    [_headImageView release];
    [_numberLable release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.numberLable = [[UILabel alloc] initWithFrame:CGRectZero];
        self.headImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        self.singerLable = [[UILabel alloc] initWithFrame:CGRectZero];
        self.songLable = [[UILabel alloc] initWithFrame:CGRectZero];
        self.dataLable = [[UILabel alloc] initWithFrame:CGRectZero];
        
        [self.contentView addSubview:self.numberLable];
        [self.contentView addSubview:self.dataLable];
        [self.contentView addSubview:self.headImageView];
        [self.contentView addSubview:self.songLable];
        [self.contentView addSubview:self.singerLable];
        
        [_numberLable release];
        [_songLable release];
        [_singerLable release];
        [_headImageView release];
        [_dataLable release];
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    self.numberLable.frame = CGRectMake(10, self.bounds.size.height / 2 - 10, 20, 21);
    self.numberLable.font = [UIFont systemFontOfSize:13];
    
    self.headImageView.frame = CGRectMake(self.numberLable.frame.size.width + self.numberLable.frame.origin.x +10, 5, self.bounds.size.height - 10, self.bounds.size.height - 10);
    self.songLable.frame = CGRectMake(self.headImageView.frame.size.width + self.headImageView.frame.origin.x + 10, self.headImageView.frame.origin.y, self.bounds.size.width / 3, 21);
    self.songLable.font = [UIFont systemFontOfSize:15];
    self.songLable.textColor = [UIColor colorWithWhite:0.800 alpha:0.8];
    
    self.singerLable.frame = CGRectMake(self.songLable.frame.origin.x, self.songLable.frame.size.height + self.songLable.frame.origin.y + 5, self.bounds.size.width / 4, 21);
    self.singerLable.font = [UIFont systemFontOfSize:13];
    self.singerLable.textColor = [UIColor colorWithWhite:0.800 alpha:0.8];
    self.dataLable.frame = CGRectMake(self.songLable.frame.size.width + self.songLable.frame.origin.x - 10, self.bounds.size.height / 2 - 10, self.bounds.size.width / 2, 21);
    self.dataLable.font = [UIFont systemFontOfSize:13];
    self.dataLable.textColor = [UIColor colorWithWhite:0.800 alpha:0.8];
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
